#include <iostream>
#include <vector>
#include <array>
#include <algorithm>
#include <cmath>
using namespace std;

void fuck(const array<int, 6>& arr0, const array<vector<uint64_t>, 6>& arr1) {
    auto& v0 = arr1[arr0[0]];
    auto& v1 = arr1[arr0[1]];
    auto& v2 = arr1[arr0[2]];
    auto& v3 = arr1[arr0[3]];
    auto& v4 = arr1[arr0[4]];
    auto& v5 = arr1[arr0[5]];
    for (auto a : v0) {
        for (auto b : v1) {
            if (a % 100 != b / 100) continue;
            for (auto c : v2) {
                if (b % 100 != c / 100) continue;
                for (auto d : v3) {
                    if (c % 100 != d / 100) continue;
                    for (auto e : v4) {
                        if (d % 100 != e / 100) continue;
                        for (auto f : v5) {
                            if (e % 100 == f / 100 && f % 100 == a / 100) {
                                cout << a + b + c + d + e + f << " = ";
                                cout << a << '+' << b << '+' << c << '+' << d << '+' << e << '+' << f << endl;
                            }
                        }
                    }
                }
            }
        }
    }
}

int main() {
    auto match = [](uint64_t n) { return 1000 < n && n < 10000 && n % 100 > 9; };
    vector<uint64_t> v3, v4, v5, v6, v7, v8;
    for (auto i = 1; i < sqrt(20000); ++i) {
        uint64_t p3 = i * (i + 1) / 2;
        if (match(p3)) v3.push_back(p3);
        uint64_t p4 = i * i;
        if (match(p4)) v4.push_back(p4);
        uint64_t p5 = i * (3 * i - 1) / 2;
        if (match(p5)) v5.push_back(p5);
        uint64_t p6 = i * (2 * i - 1);
        if (match(p6)) v6.push_back(p6);
        uint64_t p7 = i * (5 * i - 3) / 2;
        if (match(p7)) v7.push_back(p7);
        uint64_t p8 = i * (3 * i - 2);
        if (match(p8)) v8.push_back(p8);
    }
    array<vector<uint64_t>, 6> arr1 {v3, v4, v5, v6, v7, v8};
    array<int, 6> arr0 {0, 1, 2, 3, 4, 5};
    do {
        fuck(arr0, arr1);
    } while (next_permutation(arr0.begin(), arr0.end()));
}